<!doctype html>
<html lang="<?php echo lang('header_doc_lang') ?>" class="no-js">
    <head>
        <meta charset="utf-8">

        <title><?php echo $title ?></title>
        <meta name="description" content="">
        <meta name="author" content="">
        <!-- Make sure the latest version of IE is used -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <!-- Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references -->
        <link rel="shortcut icon" href="/favicon.ico">
        <link rel="apple-touch-icon" href="/apple-touch-icon.png">

        <!-- CSS - Setup -->
        <?php $this->assets->css('admin/style.css'); ?>
        <!-- CSS - Styles -->
        <?php $this->assets->css('admin/grid.css'); ?>
        <?php $this->assets->css('admin/base.css'); ?>
        <?php $this->assets->css('admin/forms.css'); ?>
        <?php $this->assets->css('admin/lists.css'); ?>
        <?php $this->assets->css('admin/calendar.css'); ?>
        <?php $this->assets->css('admin/extensions.css'); ?>
        <?php $this->assets->css('admin/visualize.css'); ?>
        <?php $this->assets->display('css'); ?>


        <!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
        <?php $this->assets->js('admin/modernizr.min.js'); ?>
    </head>

    <body class="sidebar-left chart" <?php
        if (isset($bodyid)) {
            echo ' id="' . $bodyid . '"';
        }
        ?>>
        <header>
            <div class="header-top tr">
                <p>Hello <strong><?php echo $this->session->userdata('username') ?></strong> | You have <a href="#" id="opener" class="strong">1 new message</a> | <a href="#">Settings</a> | <?php echo anchor('admin/logout', lang('g_logout')) ?></p>
            </div>
            <div class="header-middle"> 
                <!-- Start Nav -->
                <ul id="nav" class="fr ">
                    <!-- Nav - Start Help -->
                    <li class="help"><a class="help" href="#">Help</a>
                        <ul>
                            <li><a href="#">Documentation</a></li>
                            <li><a href="#">Forums</a></li>
                            <li><a href="#">Contact</a></li>
                        </ul>
                    </li>
                    <!-- Nav - End Help --> 
                    <!-- Nav - Start Settings -->
                    <li class="settings"><?php echo anchor('admin/settings', lang('admin_settings'), array('class' => 'settings')); ?>
                        <ul>
                            <li><?php echo anchor('admin/system_settings', lang('admin_system_settings')); ?></li>
                            <li><?php echo anchor('admin/database', 'Database'); ?></li>
                            <li><a href="#">Server Setup</a></li>
                        </ul>
                    </li>
                    <!-- Nav - End Settings --> 
                    <!-- Nav - Start Users -->
                    <li class="users"><a class="users" href="#"><?php echo lang('admin_users') ?></a>
                        <ul>
                            <li><?php echo anchor('admin/user_management', lang('admin_manage_user')); ?></li>
                            <li><a href="#">Manage Users</a>
                            </li>
                            <li><a href="#">User Reports</a></li>
                            <li><?php echo anchor('admin/usergroups', lang('admin_manage_usergroups')); ?></li>
                        </ul>
                    </li>
                    <!-- Nav - End Users --> 
                    <!-- Nav - Start Images -->
                    <li class="content"><a class="content" href="#"><?php echo lang('admin_images') ?></a>
                        <ul>
                            <li><?php echo anchor('admin/image_management', lang('admin_manage_images')); ?></li>
                            <li><a href="#">Page Statstics</a></li>
                            <li><a href="#">Page Categories</a></li>
                            <li><a href="#">Page Tags</a></li>
                        </ul>
                    </li>
                    <!-- Nav - End Images --> 
                    <!-- Nav - Start Help -->
                    <li class="dashboard"><?php echo anchor('admin', lang('admin_dashboard'), array('class' => 'dashboard')); ?></li>
                    <!-- Nav - End Dashboard -->
                </ul>
                <!-- End Nav --> 
                <!-- Start Logo --> 
                <img id="logo" src="<?php echo theme_url(); ?>admin/img/logo.png" alt="Admin Theme" /> 
                <!-- End Logo --> 
                <br class="cl" />
            </div>
            <div class="header-bottom"> 
                <!-- Start Breadcrumbs -->
                <?php echo set_breadcrumb(); ?>
                <!-- End Breadcrumbs --> 
            </div>
        </header>
        <div id="page">

            <aside>
                <!-- Start Live Search  -->
                <div class="block">
                    <form class="searchform" action="#">
                        <input id="livesearch" type="text" onBlur="if (this.value == '') {this.value = 'Live Search...';}" onFocus="if (this.value == 'Live Search...') {this.value = '';}" value="Live Search..." class="searchfield" />
                    </form>
                </div>


                <ul id="sidebar-nav">
                    <li><a href="#"><?php echo lang('admin_images') ?></a>

                        <ul class="drop" style="display: block;">
                            <li><?php echo anchor('admin/image_management', '<img src="' . theme_url() . 'admin/img/icons/16/image_manage.png">' . lang('admin_image_manage')); ?></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/image_add.png">Add Images</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/image_edit.png">Edit Images</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/image_delete.png">Delete Images</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Comments</a>
                        <ul class="drop">
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/comments.png">Manage Comments</a></li>

                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/comment_add.png">Add Comments</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/comment_edit.png">Edit Comments</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/comment_delete.png">Delete Comments</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Users</a>
                        <ul class="drop">
                            <li><?php echo anchor('admin/user_management', '<img src="' . theme_url() . 'admin/img/icons/16/user.png">' . lang('admin_manage_user')); ?></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/user_add.png">Add Users</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/user_edit.png">Edit Users</a></li>

                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/user_delete.png">Delete Users</a></li>
                        </ul>
                    </li>
                    <li><a href="#">Gallery</a>
                        <ul class="drop">
                            <li><?php echo anchor('admin/image_management', '<img src="' . theme_url() . 'admin/img/icons/16/image_manage.png">' . lang('admin_image_manage')); ?></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/image_add.png">Add Images</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/image_edit.png">Edit Images</a></li>
                            <li><a href="#"><img src="<?php echo theme_url(); ?>admin/img/icons/16/image_delete.png">Delete Images</a></li>
                        </ul>
                    </li>

                </ul>
                <br /> <br /> 
                <div class="block">
                </div>
            </aside>

            <div id="page-content" class="container_12"> 
                <a href="#" id="close_sidebar" class="tooltip east" title="Close Sidebar"> Close Sidebar </a>
                <a href="#" id="open_sidebar" class="tooltip east" title="Open Sidebar">Open Sidebar</a>

                <?php if (isset($page_title)) { ?>
                    <div id="page-header">
                        <h1><?php echo $page_title ?></h1>
                    </div>
                <?php } ?>
                <?php
                echo $this->message->display();
                echo $contents;
                ?>

            </div>
            <br class="cl" />
        </div>
        <!-- Javascript at the bottom for fast page loading --> 
        <?php $this->assets->js('http://www.google.com/jsapi'); ?>
        <?php $this->assets->js('admin/jquery-1.4.2.min.js'); ?>
        <?php $this->assets->js('admin/jquery-ui-1.8.1.min.js'); ?>
        <?php $this->assets->js('admin/jquery.tipsy.js'); ?>
        <?php $this->assets->js('admin/jquery.treeview.min.js'); ?>
        <?php $this->assets->js('admin/jquery.cookie.js'); ?>
        <?php $this->assets->js('admin/jquery.lightbox-0.5.min.js'); ?>
        <?php $this->assets->js('admin/jquery.wysiwyg.js'); ?>
        <?php $this->assets->js('admin/functions.js'); ?>
        <?php $this->assets->display('js'); ?>

        <!-- Page specific Javascript --> 
        <script type="text/javascript">
    
            // Load the Visualization API and the piechart package.
            google.load('visualization', '1', {'packages':['corechart']});
      
            // Set a callback to run when the Google Visualization API is loaded.
            google.setOnLoadCallback(drawChart);
      

	  
            // Handle viewport resizing
            var previousWidth = $(window).width();
            $(window).resize(function()
            {
                if (previousWidth != $(window).width())
                {
                    drawChart();
                    previousWidth = $(window).width();
                }
            });
						
            // Callback that creates and populates a data table, 
            // instantiates the pie chart, passes in the data and
            // draws it.
            function drawChart() {

                // Create our data table.
                var countries =
                    ['Unique Visits', 'Page Views'];
                var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'];
                var productionByCountry = [[165, 135, 157, 139, 136, 165],
                    [186, 164, 172, 165, 155, 180]];

                // Create and populate the data table.
                var data = new google.visualization.DataTable();
                data.addColumn('string', 'Month');
                for (var i = 0; i < countries.length; ++i) {
                    data.addColumn('number', countries[i]);
                }
                data.addRows(months.length);
                for (var i = 0; i < months.length; ++i) {
                    data.setCell(i, 0, months[i]);
                }
                for (var i = 0; i < countries.length; ++i) {
                    var country = productionByCountry[i];
                    for (var month = 0; month < months.length; ++month) {
                        data.setCell(month, i + 1, country[month]);
                    }
                }

                // Instantiate and draw our chart, passing in some options.
                var div = $('#chart_div');
                var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
                chart.draw(data, {width: div.width(), height: 350, is3D: true, title: '6 Month Traffic Report', hAxis: {title: "Month"}, vAxis: {title: "Views"}});
            }
  
        </script>


        <!--[if lt IE 7 ]>
            <script src="<?php echo theme_url(); ?>admin/js/dd_belatedpng.js"></script>
          <![endif]--> 
    </body>
</html>